﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for GIO_HANG
/// </summary>
public class GIO_HANG
{
    #region "Biến thành viên"
    public int mId;
    private string mMs;
    private string mTen_sach;
    private double mDon_gia;
    private int mSo_luong;
    private double mThanh_tien;
    #endregion
    #region "Thuộc tính"
    public int Id
    {
        get { return mId; }
        set { mId = value; }
    }
    public string Ms
    {
        get { return mMs; }
        set { mMs = value; }
    }
    public string Ten_sach
    {
        get { return mTen_sach; }
        set { mTen_sach = value; }
    }
    public double Don_gia
    {
        get { return mDon_gia; }
        set { mDon_gia = value; }
    }
    public int So_luong
    {
        get { return mSo_luong; }
        set 
        { 
            mSo_luong = value;
            if (mSo_luong > 3)
                mSo_luong = 3;
            else if (mSo_luong < 1)
                mSo_luong = 1;
        }
    }

    public double Thanh_tien
    {
        get { return mSo_luong * mDon_gia; }
    }
    #endregion
    #region "Khoi tao"
    public GIO_HANG()
    { }
    public GIO_HANG(int pID,string pMs, string pTen, double pDgia, int pSluong)
    {
        mId = pID;
        mMs = pMs;
        mTen_sach = pTen;
        mDon_gia = pDgia;
        mSo_luong = pSluong;
        if (mSo_luong > 3)
            mSo_luong = 3;
        else if (mSo_luong < 1)
            mSo_luong = 1;
    }
}
    #endregion

